Fix memory reservation in XenLinux.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 27 Jul 2005 09:24:51 +0000 (09:24 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 27 Jul 2005 09:24:51 +0000 (09:24 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c
linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c

index c025cc3d4c4ad11fae3c876cd849ab4d2faf2f5a..2e8aa94670eadc99817baa7794b9b9701835a0c6 100644 (file)
@@ -748,8 +748,10 @@ static int __init smp_scan_config (unsigned long base, unsigned long length)
                                || (mpf->mpf_specification == 4)) ) {
 
                        smp_found_config = 1;
+#ifndef CONFIG_XEN
                        printk(KERN_INFO "found SMP MP-table at %08lx\n",
                                                virt_to_phys(mpf));
+                       reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE);
                        if (mpf->mpf_physptr) {
                                /*
                                 * We cannot access to MPC table to compute
@@ -766,6 +768,10 @@ static int __init smp_scan_config (unsigned long base, unsigned long length)
                                        size = end - mpf->mpf_physptr;
                                reserve_bootmem(mpf->mpf_physptr, size);
                        }
+#else
+                       printk(KERN_INFO "found SMP MP-table at %08lx\n",
+                               ((unsigned long)bp - (unsigned long)isa_bus_to_virt(base)) + base);
+#endif
 
                        mpf_found = mpf;
                        return 1;
@@ -809,9 +815,11 @@ void __init find_smp_config (void)
         * MP1.4 SPEC states to only scan first 1K of 4K EBDA.
         */
 
+#ifndef CONFIG_XEN
        address = get_bios_ebda();
        if (address)
                smp_scan_config(address, 0x400);
+#endif
 }
 
 /* --------------------------------------------------------------------------
index 20d9fc467a993bd87b80b1c3b9b526d751c78a77..50e0cf52e187b82e012fd829a60ac3896a02cccc 100644 (file)
@@ -1060,6 +1060,7 @@ static void __init register_bootmem_low_pages(unsigned long max_low_pfn)
        }
 }
 
+#ifndef CONFIG_XEN
 /*
  * workaround for Dell systems that neglect to reserve EBDA
  */
@@ -1070,6 +1071,7 @@ static void __init reserve_ebda_region(void)
        if (addr)
                reserve_bootmem(addr, PAGE_SIZE);       
 }
+#endif
 
 #ifndef CONFIG_DISCONTIGMEM
 void __init setup_bootmem_allocator(void);
@@ -1152,6 +1154,13 @@ void __init setup_bootmem_allocator(void)
        reserve_bootmem(HIGH_MEMORY, (PFN_PHYS(min_low_pfn) +
                         bootmap_size + PAGE_SIZE-1) - (HIGH_MEMORY));
 
+#ifndef CONFIG_XEN
+       /*
+        * reserve physical page 0 - it's a special BIOS page on many boxes,
+        * enabling clean reboots, SMP operation, laptop functions.
+        */
+       reserve_bootmem(0, PAGE_SIZE);
+
        /* reserve EBDA region, it's a 4K region */
        reserve_ebda_region();
 
@@ -1176,6 +1185,7 @@ void __init setup_bootmem_allocator(void)
         */
        acpi_reserve_bootmem();
 #endif
+#endif /* !CONFIG_XEN */
 
 #ifdef CONFIG_BLK_DEV_INITRD
        if (xen_start_info.mod_start) {